﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Logistics.Configuration;
using System.IO;
using System.Configuration;

namespace Logistics
{
    public abstract class GlobalObjects
    {
        private static GlobalSetting m_GlobalSetting = null;
        /// <summary>
        /// 
        /// </summary>
        public static RegisterProduct RegisterProduct
        {
            //get{return RegisterProduct.None;}//非验证版
            get { return RegisterProduct.Required; }//验证版
        }

        public static GlobalSetting GSetting
        {
            get 
            {
                if (m_GlobalSetting == null)
                {
                    throw new Exception("请在使用前初始化对象:GlobalSetting");
                }
                return m_GlobalSetting;
            }
            set { m_GlobalSetting = value; }
        }

        public static String ConfigFileLocation
        {
            get { return Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "LogisticsCfg.xml"); }
        }

        public static String UploadXMLFileLocation
        {
            get { return Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "UploadXMLFile.xml"); }
        }

        public static UserIdentity CurrentUser
        {
            get;
            set;
        }
    }

    /// <summary>
    /// 
    /// </summary>
    public enum RegisterProduct
    {
        None,
        Required
    }
}
